/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function() {

    });

function add_category(name)
{
    $.get('/setup_creative/add_category/' + name, function(data) {
        refresh_cat_dropdown_div(data);
        });
}

function add_tag(tag_name,cat_id)
{
    $.get('/setup_creative/add_tag/' + tag_name +'/' + cat_id, function(data) {
        //alert(tag_name + "," + cat_id);
        refresh_tags_div();
    });
    
}


function refresh_tags_div()
{
    $.get('/setup_creative/refresh_tags_div', function(data) {
        $('#new_tag_name').val('');
        $('#tags_div').html(data);
    });

}

function refresh_cat_dropdown_div(cat_id)
{
    $.get('/setup_creative/refresh_cat_dropdown_div/'+cat_id, function(data) {
        document.getElementById('cat_dropdown_div').innerHTML = data;
    });

}

